/**
 * @file sun_time.h
 * @brief Brief description of sun_time.h
 * @author achdu0000@163.com
 * @version 1.0.0
 * @date 2024/07/07
 */

#ifndef SUN_TIME_H
#define SUN_TIME_H

#include <Arduino.h>
#include <lvgl.h>
#include "../../color_config/color_config.h"
#include "../../constants.h"

/**
 * set ganzhi of year now
 * @param year_ganzhi_str           the string of year ganzhi string in Chinese, like "甲子", "乙丑", ...
 * @return                          true if success
 */
bool set_now_year_ganzhi(const char *year_ganzhi_str);

/**
 * set birth year jiazi value
 * @param birth_year_ganzhi_str     the string of birth year ganzhi string in Chinese, like "甲子", "乙丑", ...
 * @return                          true if success
 */
bool set_birth_year_jiazi_val(const char *birth_year_ganzhi_str);

/**
 * get ganzhi of year now
 * 
 */
const char* get_now_year_ganzhi();


/**
 * create basic sixty jiazi clock ui
 * @param parent                    the parent of the ui widgets in `lvgl`
 * @param width                     (lv_coord_t) width of ui
 * @param height                    (lv_coord_t) height of ui
 * @param content_w_ptr             (return) the width of content
 * @param content_h_ptr             (return) the height of content
 * @return                          true if success
 * @note                            the ui created will be center of the parent in default
 */
bool create_basic_sixty_jiazi_clock_ui(lv_obj_t *parent, lv_coord_t width, lv_coord_t height, lv_coord_t *content_w_ptr, lv_coord_t *content_h_ptr);

/**
 * create extend 1 sun track and sun
 * @param parent                    the parent in lvgl widget
 * @param x_ofs                     the offset in direction x from the center of parent
 * @param y_ofs                     the offset in direction y from the center of parent
 * @return                          true if success
 */
bool create_extend_1_sun_track_and_sun_ui(lv_obj_t *parent, lv_coord_t x_ofs, lv_coord_t y_ofs);

/**
 * create extend 1 sun time connect people ui, contains:
 *     - [icon people] to show the jiazi of birth year,
 *     - [indicator arc] to show the  path from the birth year to now year
 *     - [indicator line] to show every 12 year circle
 * @param parent                    the parent in lvgl widget
 * @param border_radius             the radius of the border
 * @return                          true if success
 */
bool create_extend_1_sun_time_connect_people_ui(lv_obj_t *parent, lv_coord_t border_radius);

/**
 * create extend 2 year ganzhi label ui
 * @param parent                    the parent in lvgl widget
 * @param x_ofs                     the offset in direction x from the center of parent
 * @param y_ofs                     the offset in direction y from the center of parent
 * @return                          true if success
 */
bool create_extend_2_year_ganzhi_label_ui(lv_obj_t *parent, lv_coord_t x_ofs, lv_coord_t y_ofs);

#endif // SUN_TIME_H
